<template>
    <div class="main-page">
        <div class="main-page-top">
            <page-head-login v-if="hasLogin"></page-head-login>
            <page-head-not-login v-if="!hasLogin"></page-head-not-login>
        </div>
        <div class="main-page-bottom" :class="{'bottom1': this.isImplant == false,
			'bottom2': this.isImplant == true}">
            <!-- <page-main-login v-if="!hasLogin"></page-main-login> -->
            <memu-page v-if="hasLogin"></memu-page>
        </div>
    </div>
</template>

<script >
import pageHeadLogin from '../page_head/page_head_login.vue'
import pageHeadNotLogin from '../page_head/page_head_not_login.vue'
// import pageMainLogin from '../page_main/page_main_login.vue'
import memuPage from '../menu/memu_page.vue'
export default {
    data: function () {
        return {
        }
    },
    methods: {
        checkLogin () {
            console.log(8889, this.hasLogin)
            // 没有登录 就去登录
            if (!this.hasLogin) {
                this.$router.replace({
                    path: '/login'
                })
            }
        }
    },
    created () {
        this.checkLogin()
    },
    components: {
        pageHeadLogin,
        pageHeadNotLogin,
        // pageMainLogin,
        memuPage
    },
    watch: {
        hasLogin () {
            console.log(this.login)
            // 没有登录 就去登录
            this.checkLogin()
        }
    },
    computed: {
        hasLogin () {
            return this.$store.state.hasLogin
        },
        showPageNum () {
            return this.$store.state.showPageNum
        },
		isImplant () {
			 return this.$store.state.isImplant
		}
    }
}
</script>

<style lang="stylus" rel="stylesheet/stylus">
.main-page
    position: absolute
    width: 100%
    height: 100%

    .main-page-top
        position: absolute
        top: 0
        left: 0
        height: 64px
        width: 100%

    .main-page-bottom
        position: absolute
        left: 0
        bottom: 0
        width: 100%
        overflow-y: hidden
        overflow-x: hidden
    .bottom1
        top: 64px
    .bottom2
        top: 0px
</style>
